<!DOCTYPE html>
<html>
<head>
    <title>Events</title>
    <meta charset="utf-8">
    <link href="../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../styles/kendo.rtl.min.css" rel="stylesheet">
    <link href="../../styles/kendo.default.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.min.css" rel="stylesheet">
    <link href="../../styles/kendo.dataviz.default.min.css" rel="stylesheet">
    <script src="../../js/jquery.min.js"></script>
    <script src="../../js/kendo.all.min.js"></script>
    <script src="../content/shared/js/console.js"></script>
    <script>
        
    </script>
    
    
</head>
<body>
    
        <a class="offline-button" href="../index.html">Back</a>
    
    <div id="example">
    <div class="demo-section k-header" style="padding: 1em;">
        <div id="map"></div>
    </div>
    <script>
        function createMap() {
            $("#map").kendoMap({
                center: [39.6924, -97.3370],
                zoom: 4,
                layers: [{
                    type: "shape",
                    dataSource: {
                        type: "geojson",
                        transport: {
                            read: "../content/dataviz/map/us.geo.json"
                        }
                    },
                    style: {
                        stroke: {
                            color: "#ccebc5"
                        },
                        fill: {
                            color: "#b3cde3"
                        }
                    }
                }],
                click: onClick,
                reset: onReset,
                pan: onPan,
                panEnd: onPanEnd,
                shapeClick: onShapeClick,
                shapeCreated: onShapeCreated,
                shapeMouseEnter: onShapeMouseEnter,
                shapeMouseLeave: onShapeMouseLeave,
                zoomStart: onZoomStart,
                zoomEnd: onZoomEnd
            });
        }

        function onClick(e) {
            kendoConsole.log(kendo.format(
                "Click at :: {0}", e.location.toString()
            ));
        }

        function onReset(e) {
            kendoConsole.log("Reset");
        }

        function onPan(e) {
            kendoConsole.log(kendo.format(
                "Pan to :: {0}", e.center.toString()
            ));
        }

        function onPanEnd(e) {
            kendoConsole.log(kendo.format(
                "Pan ended at :: {0}", e.center.toString()
            ));
        }

        function onShapeClick(e) {
            kendoConsole.log(kendo.format(
                "Shape click :: {0}", e.shape.dataItem.properties.name
            ));
        }

        function onShapeCreated(e) {
            kendoConsole.log(kendo.format(
                "Shape created :: {0}", e.shape.dataItem.properties.name
            ));
        }

        function onShapeMouseEnter(e) {
            kendoConsole.log(kendo.format(
                "Shape mouseEnter :: {0}", e.shape.dataItem.properties.name
            ));
        }

        function onShapeMouseLeave(e) {
            kendoConsole.log(kendo.format(
                "Shape mouseLeave :: {0}", e.shape.dataItem.properties.name
            ));
        }

        function onZoomStart(e) {
            kendoConsole.log("Zoom start");
        }

        function onZoomEnd(e) {
            kendoConsole.log("Zoom end");
        }

        $(document).ready(createMap);
    </script>
    <div class="box">
        <h4>Console log</h4>
        <div class="console"></div>
    </div>
</div>


    
    
        <div class='demo-section'>
            <h3>Note:</h3>
            <p>
                Security restrictions prevent this example from working in all browsers when the page is loaded from the file system (via file:// protocol).
                If the demo is not working as expected, please host the Kendo folder on a web server.
            </p>
        </div>
    
</body>
</html>
